<style>
    .setimg{
        margin:-2px 5px 0 0
    }
</style>
<div class="row-fluid">
    <a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">列表数据</a>
    <div class="well">
        <div class="btn-toolbar">
            <button class="btn btn-primary ifrm" data-url="/cash/exportExcel" data-width="510" data-height="350" data-title="导出表格" data-params="" style="position:relative;float:right;padding:3px 6px;margin-right:10px" title="导出表格">导出表格</button>
            <form>
                <label style="display: inline;">用户名称：</label><input class="input input-medium" type="text" name="cust_realname" value="<?=I('get.cust_realname')?>" />
                <label style="display: inline;margin-left:10px">手机号码：</label><input class="input input-medium" type="text" name="cust_mobile" value="<?=I('get.cust_mobile')?>" />
                <label style="display: inline;margin-left:10px">打款状态：</label>
                <select name="cash_status" style="width: 150px">
                    <option value="all">全部</option>
                    <option value="0">未处理</option>
                    <option value="1">打款成功</option>
                </select>
                <input type="hidden" value="<?=I('get.res')?>" name="res" />
                <button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
            </form>
        </div>
        <hr>
        <table class="table">
            <thead>
            <tr>
                <th style="text-align:center;width:100px">序号id</th>
                <th style="text-align:center;width:100px">提现金额</th>
                <th style="text-align:center;">用户姓名</th>
                <th style="text-align:center;">提现参数</th>
                <th style="text-align:center;width:180px">手机号码</th>
                <th style="text-align:center;width:140px">审核时间</th>
                <th style="text-align:center;width:140px">打款状态</th>
                <th style="text-align:center;width:130px">操作</th>
            </tr>
            </thead>
            <tbody>
            <if condition="$getData">
            <foreach name="getData" item="vo">
            <tr>
                <td style="text-align:center;vertical-align:middle;">{{$vo.cust_cashid}}</td>
                <td style="text-align:center;vertical-align:middle;">{{$vo.cash_money}}</td>
                <td style="text-align:center;vertical-align:middle;">{{$vo.cust_realname}}</td>
                <td style="text-align:center;vertical-align:middle;">
                    <center>
                        <table style="text-align:center">
                            <tr>
                                <td>账户姓名：{{$vo.bank_uname}}</td>
                                <td>账户类型：{{$vo.bank_name}}</td>
                            </tr>
                            <tr>
                                <td colspan=2>提现帐号：{{$vo.bank_card}}</td>
                            </tr>
                        </table>
                    </center>
                </td>
                <td style="text-align:center;vertical-align:middle;">{{$vo.cust_mobile}}</td>
                <td style="text-align:center;vertical-align:middle;">{{$vo.update_at|date='Y-m-d H:i:s',###}}</td>
                <td style="text-align:center;vertical-align:middle;">
                    <if condition="$vo['cash_status'] eq 0">
                    <span class="label label-default">未处理</span>
                    <else/>
                        <span class="label label-success">打款成功</span>
                    </if>
                </td>
                <td style="text-align:center;vertical-align:middle;">
                    <if condition="$vo['cash_status'] eq 0">
                    <a class="btn btn-primary icheck" style="padding: 2px 10px" href="#myModal" data-toggle="modal" itv="{{$vo.cust_cashid}}">处理</a>
                    <else/>
                        -
                    </if>
                </td>
            </tr>
            </foreach>
            <else/>
            <tr><td style="text-align:center" colspan=8>暂无数据</td></tr>
            </if>
            </tbody>
        </table>
        <span style="float:right;margin-top:-44px"><?=$page?></span>
    </div>
</div>
<div class="modal small hide fade" itav="0" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">处理结果</h3>
    </div>
    <div class="modal-body">
        <p class="error-text"><center>
        <select name="status" id="ostatus" style="width:180px">
            <option value='1'>确认打款，提现成功</option>
        </select>
    </center></p>
        <input type="hidden" value="0" class="setCashId" />
    </div>
    <div class="modal-footer">
        <button class="btn" id="setResult" data-dismiss="modal" aria-hidden="true">确定</button>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        $('.icheck').click(function(){
            $('.setCashId').val($(this).attr('itv'));
        });
        $('#setResult').click(function(){
            if($('.setCashId').val()>0){
                art.dialog({
                    title: '',
                    lock: true,
                    background: '#333',
                    opacity: 0.87,
                    drag: false,
                    resize: false,
                    content: '<img src="/statics/arts/skins/icons/loading.gif" /> 处理中，请稍候..'
                });
                $.post('/cash/setCash',{'status':$('#ostatus :selected').val(),'cashid':$('.setCashId').val()},function(data){
                    var list = art.dialog.list;
                    for (var i in list) {
                        list[i].close();
                    };
                    showmsg(data.msg,data.code);
                    setTimeout(function(){location.reload();},1000);
                },'json');
            }
        });
    });
</script>